package com.mingqijia.gassafety.webserver.listeners;

import cn.hutool.extra.spring.SpringUtil;
import com.mingqijia.gassafety.shared.constant.Constants;
import com.mingqijia.gassafety.webserver.webSocket.RedisTopicSendTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author: duanhongxiang
 * @Desc:
 * @create: 2024-09-03 18:01
 **/
@Slf4j
@Component
public class OrderAutoGenProcess {

    private RedisTopicSendTemplate redisTopicSendTemplate = SpringUtil.getBean(RedisTopicSendTemplate.class);

    //统一入口
    public  void redisTopicSendMsg(String spId, String message) {
        log.info("redisTopicSendMsg：spId={},message={}",spId,message);
        redisTopicSendTemplate.sendMsg(Constants.TOPIC_ORDER_AUTO_CREATE,message+";;"+spId);
    }
}
